package com.matt.main;

import java.util.Arrays;

import com.matt.mergesort.MergeSort;
import com.matt.quicksort.QuickSort;

public class Main
{
    
    /**
     * @param args
     */
    public static void main(String[] args)
    {
        /*ArraySort is = new ArraySort();
        
        int[] randomArr = new int[500000];
        for(int i = 0; i < randomArr.length; i++) {
            randomArr[i] = (int) (Math.random() * 1000) + 10;
        }
        is.insertionSort(randomArr);
        
        int[] unsorted = { 45, 23, 12, 99, 103, 23, 1, 0, 100 };
        System.out.println("unsorted array: " + Arrays.toString(unsorted));
        
        is.insertionSort(unsorted);
        
        System.out.println("sorted array: " + Arrays.toString(unsorted));
        
        
        int[] newArr = { 45, 23, 12, 99, 103, 23, 1, 0, 100,15 };
        System.out.println("unsorted array: " + Arrays.toString(newArr));
        
        is.mergeSort(newArr, 0, newArr.length);
        
        System.out.println("sorted array: " + Arrays.toString(newArr));*/
        
        int[] arrayOne = { 10, 8, 6, 4, 2, 9, 7, 5, 3, 1, 20, 18, 16, 14, 12, 19, 17, 15, 13, 11 };
        System.out.println("unsorted array: " + Arrays.toString(arrayOne));
        
        // MergeSort
        MergeSort ms = new MergeSort();
        System.out.println("mergesort array: " + Arrays.toString(ms.sort(arrayOne)));
        
        // QuickSort
        QuickSort qs = new QuickSort();
        qs.sort(arrayOne, 0 , arrayOne.length - 1);
        System.out.println("quicksort array: " + Arrays.toString(arrayOne));
    }
}
